From ae2a42318c684d292bacdd624c7d7f30233d7308 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Sat, 28 Jun 2014 17:07:49 -0700 Subject: [PATCH] Future proof URL canonicalization tests --- src/cargo/sources/git/source.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/cargo/sources/git/source.rs b/src/cargo/sources/git/source.rs index 772c3caa6..11f86c6c5 100644 --- a/src/cargo/sources/git/source.rs +++ b/src/cargo/sources/git/source.rs @@ -195,20 +195,23 @@ mod test { #[test] fn test_canonicalize_idents_by_stripping_trailing_url_slash() { - let ident = ident(&Remote(url("https://github.com/PistonDevelopers/piston/"))); - assert_eq!(ident.as_slice(), "piston-1ad60373965e5b42"); + let ident1 = ident(&Remote(url("https://github.com/PistonDevelopers/piston/"))); + let ident2 = ident(&Remote(url("https://github.com/PistonDevelopers/piston"))); + assert_eq!(ident1, ident2); } #[test] fn test_canonicalize_idents_by_lowercasing_github_urls() { - let ident = ident(&Remote(url("https://github.com/PistonDevelopers/piston"))); - assert_eq!(ident.as_slice(), "piston-1ad60373965e5b42"); + let ident1 = ident(&Remote(url("https://github.com/PistonDevelopers/piston"))); + let ident2 = ident(&Remote(url("https://github.com/pistondevelopers/piston"))); + assert_eq!(ident1, ident2); } #[test] fn test_canonicalize_idents_by_stripping_dot_git() { - let ident = ident(&Remote(url("https://github.com/PistonDevelopers/piston.git"))); - assert_eq!(ident.as_slice(), "piston-1ad60373965e5b42"); + let ident1 = ident(&Remote(url("https://github.com/PistonDevelopers/piston"))); + let ident2 = ident(&Remote(url("https://github.com/PistonDevelopers/piston.git"))); + assert_eq!(ident1, ident2); } fn url(s: &str) -> Url { -- 2.30.2